import * as actionTypes from './constants';

const defaultstate = {
    index: 4
}

const reducer = (state = defaultstate, action) => {
    const { type, data } = action

    switch (type) {
        case actionTypes.CHANGE_INDEX:
            // console.log("进入了reducer")
            return { ...state, index: data }
        default:
            return state;
    }
}
export default reducer;